<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
{{assign var="title" value='表单验证'}}
{{assign var="app" value='form'}}
{{assign var="act" value='index'}}
{{assign var="table" value='form'}}
{{assign var="td" value='7'}}
<title>{{$title}}管理 - {{'admin|admin_site_name'|C|default:'后台管理'}}</title>
{{include file="include/base.html"}}
{{include file="{{$smarty.const.PLUG}}chosen/chosen.html"}}
{{include file="{{$smarty.const.PLUG}}drag/drag.html"}}
{{include file="{{$smarty.const.PLUG}}tip/tip.html"}}
</head>
<body>

	{{include file="include/sidebar.html"}}
	<div class="body_right">
	<div id="content">
			
		<!--循环内容 S-->
		<form action="index.php?app={{$app}}" name="form" class="form" method="post">
		<input type="hidden" name="app" value="{{$app}}"/>
		<input type="hidden" name="act" value=""/>
		<input type="hidden" name="table" value="{{$table}}"/>
		<table class="table table-bordered drags saveorder" date="{{'table=form&field=ordering'|encode}}">
		  <tbody>
			<tr class="thead">
			  <td colspan="{{$td}}">
			  	<div class="floatr"><a class="btn iframe" href="index.php?app=category&act=modify&id={{$smarty.get.cat_id}}&iframe=true">查看分类</a></div>
			 	◆ <a href="index.php?app=form">{{$title}}管理</a> －＞ {{$title}}列表 －＞ {{$current.title}}
			  	<span class="notice"><表单模型名称{{$current.item}}></span>
			  </td>
			</tr>
			{{if $result|@count eq 0}}{{*是否有显示结果 S*}}
			<tr><td colspan="{{$td}}">没有关联表...</td></tr>
			{{else}}

			<tr class="ttitle">
			  <td colspan="{{$td-1}}">自定义表单字段</td>
			  <td><a class="iframe btn" width="650" height="390" href="index.php?app=form&act=modify&cat_id={{$smarty.get.cat_id}}&is_custom=1&iframe=true"><i class="icon-plus"></i>添加字段</a></td>
			</tr>
			<tr class="ttitle">
			  <td width="40px">状态</td>
			  <td width="15%">字段名</td>
			  <td width="17%">标题</td>
			  <td width="140px">控件类型</td>
			  <td width="80px">验证规则</td>
			  <td width="">描述</td>
			  <td width="90px">操作</td>
			</tr>
			{{if !$form}}
				<tr><td colspan="{{$td}}">暂无数据...</td></tr>
			{{else}}
				{{foreach from=$form item=val key=key}}
				<tr class="drag">
				  {{*状态*}}<td> <a class="ajaxSubmit refresh" {{if $val.publish!=''}}link="index.php?app=functions&act=setValue&value={{!$val.publish}}&params={{'table='|cat:$table|cat:'&field=publish&id='|cat:$val.id|encode}}"{{else}}href="javascript:"{{/if}}><span class="select_{{$val.publish}}"></span></a> </td>
				  {{*字段名*}}<td>{{$val.field_name}} {{if $val.params.white==1}}<i class="icon icon-star-empty" title="白名单"></i>{{/if}} {{if $val.params.indexing==1}}<i class="icon icon-search" title="索引"></i>{{/if}}</td>
				  {{*标题*}}<td>
				  				{{if $val.params.white!=1}}<span class="label tip" title="{{$val.code}}">code</span>{{/if}} 
				  				{{$val.title|default:'/'}} 
								{{*复制*}}<a class='label label-info iframe' width="600" height="210" title="复制到其它表单模型" href="index.php?app={{$app}}&act=copy&id={{$val.id}}&iframe=true">复制</a> 
							</td>
				  {{*控件类型*}}<td>{{if $widget_type[$val.widget_type]}}{{$widget_type[$val.widget_type]}}{{/if}}</td>
				  {{*验证规则*}}<td>{{$val.verify_rule|default:'/'}}</td>
				  {{*描述*}}<td>{{$val.description|default:'/'}}</td>
				  <td>
					<input name="ids[]" value="{{$val.id}}" type="hidden"/>
					{{*编辑*}}<a class='btn iframe' width="650" height="390" title="编辑" href="index.php?app={{$app}}&act=modify&cat_id={{$smarty.get.cat_id}}&id={{$val.id}}&field_name={{$val.field_name}}"><i class="icon-edit"></i></a>
					{{*删除*}}<a class='btn confirm ajaxSubmit refresh btn-danger' title="确定要删除吗" link="index.php?app=form&act=delete&id={{$val.id}}"><i class="icon-trash icon-white"></i></a>
				  </td>
				</tr>
				{{/foreach}}
			{{/if}}
			<tr class="ttitle">
			  <td colspan="7">主表字段　{{if !$mainTable}}<span class="red">(未指定主表)</span>{{/if}}</td>
			</tr>
			<tr class="ttitle">
			  <td>状态</td>
			  <td>字段名</td>
			  <td>标题</td>
			  <td>控件类型</td>
			  <td>验证规则</td>
			  <td>描述</td>
			  <td>操作</td>
			</tr>
			{{if !$result}}
			<tr><td colspan="{{$td}}">暂无数据...</td></tr>
			{{else}}
			{{foreach from=$result item=val key=key}}
			<tr>
			  {{*状态*}}<td> <a class="ajaxSubmit refresh cursordefault" {{if $val.publish!=''}}link="index.php?app=functions&act=setValue&value={{!$val.publish}}&params={{'table='|cat:$table|cat:'&field=publish&id='|cat:$val.id|encode}}"{{else}}href="javascript:"{{/if}}><span class="select_{{$val.publish}}"></span></a> </td>
			  {{*字段名*}}<td>{{$key}}</td>
			  {{*标题*}}<td>{{$val.title|default:'/'}}</td>
			  {{*控件类型*}}<td>{{if $widget_type[$val.widget_type]}}{{$widget_type[$val.widget_type]}}{{else}}/{{/if}}</td>
			  {{*验证规则*}}<td>{{$val.verify_rule|default:'/'}}</td>
			  {{*描述*}}<td>{{$val.description|default:'/'}}</td>
			  <td>
				{{*编辑*}}<a class='btn iframe' width="650" height="390" href="index.php?app={{$app}}&act=modify&cat_id={{$smarty.get.cat_id}}&id={{$val.id}}&field_name={{$key}}">{{if $val.id>0}}<i class="icon-edit"></i>{{else}}<i class="icon-plus"></i>添加{{/if}}</a>
				{{*删除*}}{{if $val.id>0}}<a class='btn btn-danger confirm ajaxSubmit refresh' title="确定要清空该字段数据吗?(该操作不会删除该字段)" link="index.php?app=functions&act=delete&table=form&id={{$val.id}}"><i class="icon-trash icon-white"></i></a>{{/if}}
			  </td>
			</tr>
			{{/foreach}}
			{{/if}}
			
			{{/if}}{{*是否有显示结果 E*}}
		  </tbody>
		 </table>
		</form>
		<!--循环内容 E-->
		
</div>
</div>

</body>
</html>